<template>
	<view>
		<view class="content">
			<view class="list" v-for="(item,index) in huashu" :key="index">
				<view class="head">
					<image :src="getHead(head_img)" mode=""></image>
				</view>
				<view class="bubble">
					{{item.content}}
				</view>
			</view>
			<view class="list">
				<view class="head">
					<image :src="getHead(head_img)" mode=""></image>
				</view>
				<view class="code">
					<view class="title">
						为了更好的为您服务，请添加客服微信
					</view>
					<image @click="seeImage(img_pre+ewm)" :src="img_pre+ewm" id="myCanvas"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var than;
	export default {
		data() {
			return {
				ewm: "",
				head_img: "",
				huashu: []
			}
		},
		onLoad(option) {
			than = this;
			than.post("api/center/seeKeFu", null, function(data) {
				than.ewm = data.qr_code
				than.head_img = data.head_img
				than.huashu = data.huashu
			})
		},
		methods: {
			save_but() {
				uni.showLoading();
				uni.canvasToTempFilePath({
					canvasId: 'firstCanvas',
					success: function(res) {
						uni.hideLoading()
						than.download(res.tempFilePath)
					},
					fail: function(res) {
						console.log(res);
					}
				})
			},
		}
	}
</script>

<style lang="less">
	page {
		background: #F8F8F8;
	}

	#myCanvas {
		width: 416rpx;
		height: 416rpx;
		display: block;
		margin: 29rpx auto 0;
	}

	.content {
		padding-top: 50rpx;

		.list {
			display: flex;
			align-items: center;
			margin-bottom: 45rpx;

			.head {
				margin: 0 20rpx 0 40rpx;

				image {
					width: 84rpx;
					height: 83.3rpx;
					border-radius: 50%;
				}
			}

			.bubble {
				padding: 0 39rpx;
				line-height: 124rpx;
				border-radius: 0 40rpx 40rpx 40rpx;
				background: #FFFFFF;
			}

			.code {
				background: #FFFFFF;
				border-radius: 30rpx;

				.title {
					line-height: 99rpx;
					height: 99rpx;
					margin: 0 39rpx;
					border-bottom: 1px solid #EEEEEE;
				}

				.u-button {
					width: 220rpx;
					height: 86rpx;
					background: #FDF4ED;
					border-radius: 43rpx;
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #F66337;
					margin: 25rpx auto;
				}
			}
		}
	}
</style>
